/**
 * Copyright (c) 2014, 2020 itemis AG (http://www.itemis.eu) and others.
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 * 
 * SPDX-License-Identifier: EPL-2.0
 */
package org.eclipse.xtend.core.tests.compiler;

import org.eclipse.xtend2.lib.StringConcatenation;
import org.junit.Test;

/**
 * @author Sebastian Zarnekow - Initial contribution and API
 */
@SuppressWarnings("all")
public class CompilerBug427637Test extends AbstractXtendCompilerTest {
  @Test
  public void testBug_427637_01() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<? extends V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.forEach2 [");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <T> void forEach2(Iterable<T> iterable, (T)=>void procedure) {}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<? extends V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Procedure1<V> _function = new Procedure1<V>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void apply(final V it) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("this.forEach2(list, _function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <T extends Object> void forEach2(final Iterable<T> iterable, final Procedure1<? super T> procedure) {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_01_b() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<? extends V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.forEach [");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import java.util.function.Consumer;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<? extends V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Consumer<V> _function = new Consumer<V>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void accept(final V it) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("list.forEach(_function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_02() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.forEach2 [");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <T> void forEach2(Iterable<T> iterable, (T)=>void procedure) {}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Procedure1<V> _function = new Procedure1<V>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void apply(final V it) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("this.<V>forEach2(list, _function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <T extends Object> void forEach2(final Iterable<T> iterable, final Procedure1<? super T> procedure) {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_02_b() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.forEach [");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import java.util.function.Consumer;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Consumer<V> _function = new Consumer<V>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void accept(final V it) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("list.forEach(_function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_03() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<? super V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.forEach2 [");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <T> void forEach2(Iterable<T> iterable, (T)=>void procedure) {}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<? super V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Procedure1<Object> _function = new Procedure1<Object>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void apply(final Object it) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("this.forEach2(list, _function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <T extends Object> void forEach2(final Iterable<T> iterable, final Procedure1<? super T> procedure) {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_03_b() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<? super V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.forEach [");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import java.util.function.Consumer;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<? super V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Consumer<Object> _function = new Consumer<Object>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void accept(final Object it) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("list.forEach(_function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_04() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<? extends V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.subList(1,1).forEach2 [");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <T> void forEach2(Iterable<T> iterable, (T)=>void procedure) {}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<? extends V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Procedure1<V> _function = new Procedure1<V>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void apply(final V it) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("this.forEach2(list.subList(1, 1), _function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <T extends Object> void forEach2(final Iterable<T> iterable, final Procedure1<? super T> procedure) {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_04_b() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<? extends V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.subList(1,1).forEach [");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import java.util.function.Consumer;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<? extends V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Consumer<V> _function = new Consumer<V>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void accept(final V it) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("list.subList(1, 1).forEach(_function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_05() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.subList(1,1).forEach2 [");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <T> void forEach2(Iterable<T> iterable, (T)=>void procedure) {}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Procedure1<V> _function = new Procedure1<V>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void apply(final V it) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("this.<V>forEach2(list.subList(1, 1), _function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <T extends Object> void forEach2(final Iterable<T> iterable, final Procedure1<? super T> procedure) {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_05_b() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.subList(1,1).forEach [");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import java.util.function.Consumer;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Consumer<V> _function = new Consumer<V>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void accept(final V it) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("list.subList(1, 1).forEach(_function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_06() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<? super V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.subList(1,1).forEach2 [");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <T> void forEach2(Iterable<T> iterable, (T)=>void procedure) {}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<? super V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Procedure1<Object> _function = new Procedure1<Object>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void apply(final Object it) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("this.forEach2(list.subList(1, 1), _function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <T extends Object> void forEach2(final Iterable<T> iterable, final Procedure1<? super T> procedure) {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_06_b() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<? super V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.subList(1,1).forEach [");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import java.util.function.Consumer;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<? super V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Consumer<Object> _function = new Consumer<Object>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void accept(final Object it) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("list.subList(1, 1).forEach(_function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_07() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<? extends V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.subList(1,1).forEach2 [");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("it.toString");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <T> void forEach2(Iterable<T> iterable, (T)=>void procedure) {}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<? extends V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Procedure1<V> _function = new Procedure1<V>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void apply(final V it) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("it.toString();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("this.forEach2(list.subList(1, 1), _function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <T extends Object> void forEach2(final Iterable<T> iterable, final Procedure1<? super T> procedure) {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_07_b() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<? extends V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.subList(1,1).forEach [");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("it.toString");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import java.util.function.Consumer;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<? extends V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Consumer<V> _function = new Consumer<V>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void accept(final V it) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("it.toString();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("list.subList(1, 1).forEach(_function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_08() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.subList(1,1).forEach2 [");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("it.toString");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <T> void forEach2(Iterable<T> iterable, (T)=>void procedure) {}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Procedure1<V> _function = new Procedure1<V>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void apply(final V it) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("it.toString();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("this.<V>forEach2(list.subList(1, 1), _function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <T extends Object> void forEach2(final Iterable<T> iterable, final Procedure1<? super T> procedure) {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_08_b() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.subList(1,1).forEach [");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("it.toString");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import java.util.function.Consumer;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Consumer<V> _function = new Consumer<V>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void accept(final V it) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("it.toString();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("list.subList(1, 1).forEach(_function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_09() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<? super V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.subList(1,1).forEach2 [");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("it.toString");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <T> void forEach2(Iterable<T> iterable, (T)=>void procedure) {}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<? super V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Procedure1<Object> _function = new Procedure1<Object>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void apply(final Object it) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("it.toString();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("this.forEach2(list.subList(1, 1), _function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <T extends Object> void forEach2(final Iterable<T> iterable, final Procedure1<? super T> procedure) {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_09_b() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<? super V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.subList(1,1).forEach [");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("it.toString");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import java.util.function.Consumer;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<? super V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Consumer<Object> _function = new Consumer<Object>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void accept(final Object it) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("it.toString();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("list.subList(1, 1).forEach(_function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_10() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<? extends V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("val List<V> target = null");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.forEach2 [");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("target += it");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <T> void forEach2(Iterable<T> iterable, (T)=>void procedure) {}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<? extends V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final List<V> target = null;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Procedure1<V> _function = new Procedure1<V>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void apply(final V it) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("target.add(it);");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("this.forEach2(list, _function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <T extends Object> void forEach2(final Iterable<T> iterable, final Procedure1<? super T> procedure) {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_10_b() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <V> m(List<? extends V> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("val List<V> target = null");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.forEach [");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("target += it");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import java.util.function.Consumer;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <V extends Object> void m(final List<? extends V> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final List<V> target = null;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Consumer<V> _function = new Consumer<V>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void accept(final V it) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("target.add(it);");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("list.forEach(_function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_11() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <T> m(List<? extends T> list) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("val List<T> target = null");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("list.subList(0,1).forEach [");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("target.subList(0, 1) += it");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("target.subList(0, 1) -= it");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("target.subList(0, 1) += newArrayList(it)");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("target.subList(0, 1) -= newArrayList(it)");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import com.google.common.collect.Iterables;");
    _builder_1.newLine();
    _builder_1.append("import java.util.ArrayList;");
    _builder_1.newLine();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import java.util.function.Consumer;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.CollectionLiterals;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <T extends Object> void m(final List<? extends T> list) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final List<T> target = null;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Consumer<T> _function = new Consumer<T>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void accept(final T it) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("List<T> _subList = target.subList(0, 1);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("_subList.add(it);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("List<T> _subList_1 = target.subList(0, 1);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("_subList_1.remove(it);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("List<T> _subList_2 = target.subList(0, 1);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("ArrayList<T> _newArrayList = CollectionLiterals.<T>newArrayList(it);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("Iterables.<T>addAll(_subList_2, _newArrayList);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("List<T> _subList_3 = target.subList(0, 1);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("ArrayList<T> _newArrayList_1 = CollectionLiterals.<T>newArrayList(it);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("Iterables.removeAll(_subList_3, _newArrayList_1);");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("list.subList(0, 1).forEach(_function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_12() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class Listener<T extends Node & XActivatable> implements ListChangeListener<T> {");
    _builder.newLine();
    _builder.append("\t");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("Group layer");
    _builder.newLine();
    _builder.append("\t");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override onChanged(Change<? extends T> change) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("while(change.next) {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("if(change.wasAdded)");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("change.addedSubList.forEach [ T it | // Xtend bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=427637");
    _builder.newLine();
    _builder.append("\t\t\t\t\t");
    _builder.append("layer.children += it");
    _builder.newLine();
    _builder.append("\t\t\t\t\t");
    _builder.append("it.activate()");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("if(change.wasRemoved) ");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("change.removed.forEach [ T it | // Xtend bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=427637");
    _builder.newLine();
    _builder.append("\t\t\t\t\t");
    _builder.append("layer.children -= it");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("interface ObservableList<E> extends Observable, List<E> {}");
    _builder.newLine();
    _builder.append("interface Observable {} ");
    _builder.newLine();
    _builder.append("interface Node {}");
    _builder.newLine();
    _builder.append("interface Group extends Node {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def ObservableList<Node> getChildren()");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("interface XActivatable {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void activate()");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("interface ListChangeListener<E> {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void onChanged(Change<? extends E> c)");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("interface Change<E> {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def List<E> getAddedSubList()");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def List<E> getRemoved()");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def boolean next()");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def boolean wasAdded()");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def boolean wasRemoved()");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.function.Consumer;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Listener<T extends Node & XActivatable> implements ListChangeListener<T> {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("private Group layer;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public void onChanged(final Change<? extends T> change) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("while (change.next()) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("{");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("boolean _wasAdded = change.wasAdded();");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("if (_wasAdded) {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("final Consumer<T> _function = new Consumer<T>() {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("public void accept(final T it) {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("ObservableList<Node> _children = Listener.this.layer.getChildren();");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_children.add(it);");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("it.activate();");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("change.getAddedSubList().forEach(_function);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("boolean _wasRemoved = change.wasRemoved();");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("if (_wasRemoved) {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("final Consumer<T> _function_1 = new Consumer<T>() {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("public void accept(final T it) {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("ObservableList<Node> _children = Listener.this.layer.getChildren();");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_children.remove(it);");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("change.getRemoved().forEach(_function_1);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_13() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class Listener<T extends Node & XActivatable> implements ListChangeListener<T> {");
    _builder.newLine();
    _builder.append("\t");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("Group layer");
    _builder.newLine();
    _builder.append("\t");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("override onChanged(Change<? extends T> change) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("while(change.next) {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("if(change.wasAdded)");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("change.addedSubList.forEach [");
    _builder.newLine();
    _builder.append("\t\t\t\t\t");
    _builder.append("layer.children += it");
    _builder.newLine();
    _builder.append("\t\t\t\t\t");
    _builder.append("it.activate()");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("if(change.wasRemoved) ");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("change.removed.forEach [");
    _builder.newLine();
    _builder.append("\t\t\t\t\t");
    _builder.append("layer.children -= it");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("interface ObservableList<E> extends Observable, List<E> {}");
    _builder.newLine();
    _builder.append("interface Observable {} ");
    _builder.newLine();
    _builder.append("interface Node {}");
    _builder.newLine();
    _builder.append("interface Group extends Node {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def ObservableList<Node> getChildren()");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("interface XActivatable {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void activate()");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("interface ListChangeListener<E> {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void onChanged(Change<? extends E> c)");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("interface Change<E> {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def List<E> getAddedSubList()");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def List<E> getRemoved()");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def boolean next()");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def boolean wasAdded()");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def boolean wasRemoved()");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.function.Consumer;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Listener<T extends Node & XActivatable> implements ListChangeListener<T> {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("private Group layer;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public void onChanged(final Change<? extends T> change) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("while (change.next()) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("{");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("boolean _wasAdded = change.wasAdded();");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("if (_wasAdded) {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("final Consumer<T> _function = new Consumer<T>() {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("public void accept(final T it) {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("ObservableList<Node> _children = Listener.this.layer.getChildren();");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_children.add(it);");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("it.activate();");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("change.getAddedSubList().forEach(_function);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("boolean _wasRemoved = change.wasRemoved();");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("if (_wasRemoved) {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("final Consumer<T> _function_1 = new Consumer<T>() {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("public void accept(final T it) {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("ObservableList<Node> _children = Listener.this.layer.getChildren();");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_children.remove(it);");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("change.getRemoved().forEach(_function_1);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_14() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.List");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class Listener { // implements ListChangeListener<T> {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("Group layer");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <T> onChanged(Change<? extends T> change) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("change.addedSubList.forEach2 [");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("layer.children += it");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <T> void forEach2(Iterable<T> iterable, (T)=>void procedure) {}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("interface ObservableList<E> extends Observable, List<E> {}");
    _builder.newLine();
    _builder.append("interface Observable {} ");
    _builder.newLine();
    _builder.append("interface Node {}");
    _builder.newLine();
    _builder.append("interface Group extends Node {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def ObservableList<Object> getChildren()");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("interface XActivatable {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void activate()");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("interface ListChangeListener<E> {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void onChanged(Change<? extends E> c)");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("interface Change<E> {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def List<E> getAddedSubList()");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def List<E> getRemoved()");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def boolean next()");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def boolean wasAdded()");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def boolean wasRemoved()");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Listener {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("private Group layer;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <T extends Object> void onChanged(final Change<? extends T> change) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Procedure1<T> _function = new Procedure1<T>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public void apply(final T it) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("ObservableList<Object> _children = Listener.this.layer.getChildren();");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("_children.add(it);");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("this.forEach2(change.getAddedSubList(), _function);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public <T extends Object> void forEach2(final Iterable<T> iterable, final Procedure1<? super T> procedure) {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void testBug_427637_15() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("package org.eclipse.xtext.xbase.formatting");
    _builder.newLine();
    _builder.newLine();
    _builder.append("import com.google.inject.Inject");
    _builder.newLine();
    _builder.append("import org.eclipse.xtext.nodemodel.INode");
    _builder.newLine();
    _builder.append("import org.eclipse.xtext.xbase.lib.util.ToStringHelper");
    _builder.newLine();
    _builder.newLine();
    _builder.append("import static org.eclipse.xtext.xbase.formatting.XbaseFormatterPreferenceKeys.*");
    _builder.newLine();
    _builder.append("import org.eclipse.xtext.preferences.PreferenceKey");
    _builder.newLine();
    _builder.newLine();
    _builder.append("class FormattingDataFactory {");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t");
    _builder.append("@Inject extension HiddenLeafAccess");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def protected (FormattableDocument)=>Iterable<FormattingData> newFormattingData(");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("HiddenLeafs leafs,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("(FormattingDataInit)=>void init");
    _builder.newLine();
    _builder.append("\t");
    _builder.append(") {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("val data = new FormattingDataInit()");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("init.apply(data)");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("newFormattingData(leafs, data.key, data)");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def protected dispatch (FormattableDocument)=>Iterable<FormattingData> newFormattingData(HiddenLeafs leafs,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("Void key, FormattingDataInit it) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("[ FormattableDocument doc |");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("val int newLines2 = newLines ?: 0");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("if ((space == null && newLines == null) || (leafs.newLinesInComments == 0 && (newLines2 == 0 || space == \"\")))");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("return newWhitespaceData(leafs, space, increaseIndentationChange, decreaseIndentationChange, doc.debugConflicts)");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("else");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("return newNewLineData(leafs, newLines2, newLines2, increaseIndentationChange, decreaseIndentationChange, doc.debugConflicts)");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def protected dispatch (FormattableDocument)=>Iterable<FormattingData> newFormattingData(");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("HiddenLeafs leafs,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("BlankLineKey key,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("FormattingDataInit it");
    _builder.newLine();
    _builder.append("\t");
    _builder.append(") {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("[ FormattableDocument doc |");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("val blankline = doc.cfg.get(key)");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("val preserve = doc.cfg.get(preserveBlankLines)");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("val min = blankline + 1");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("val max = Math.max(preserve + 1, min)");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("newNewLineData(leafs, min, max, increaseIndentationChange, decreaseIndentationChange, doc.debugConflicts)");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def protected dispatch (FormattableDocument)=>Iterable<FormattingData> newFormattingData(");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("HiddenLeafs leafs,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("NewLineOrPreserveKey key,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("FormattingDataInit it");
    _builder.newLine();
    _builder.append("\t");
    _builder.append(") {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("[ FormattableDocument doc |");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("val newLine = doc.cfg.get(key)");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("val preserve = doc.cfg.get(preserveNewLines)");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("newNewLineData(leafs, if (newLine) 1 else 0, if (preserve || newLine) 1 else 0, increaseIndentationChange, decreaseIndentationChange,");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("doc.debugConflicts)");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def protected dispatch (FormattableDocument)=>Iterable<FormattingData> newFormattingData(");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("HiddenLeafs leafs,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("NewLineKey key,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("FormattingDataInit it");
    _builder.newLine();
    _builder.append("\t");
    _builder.append(") {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("[ FormattableDocument doc |");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("val newLine = doc.cfg.get(key)");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("val minmax = if (newLine) 1 else 0");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("newNewLineData(leafs, minmax, minmax, increaseIndentationChange, decreaseIndentationChange, doc.debugConflicts)");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def protected dispatch (FormattableDocument)=>Iterable<FormattingData> newFormattingData(");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("HiddenLeafs leafs,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("PreferenceKey key,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("FormattingDataInit it");
    _builder.newLine();
    _builder.append("\t");
    _builder.append(") {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("throw new RuntimeException(\"Unknown configuration key kind: \" + key.^class)");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def protected dispatch (FormattableDocument)=>Iterable<FormattingData> newFormattingData(HiddenLeafs leafs,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("WhitespaceKey key, FormattingDataInit it) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("[ FormattableDocument doc |");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("val space = doc.cfg.get(key)");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("newWhitespaceData(leafs, if (space) \" \" else \"\", increaseIndentationChange, decreaseIndentationChange, doc.debugConflicts)");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def protected Iterable<FormattingData> newWhitespaceData(");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("HiddenLeafs leafs,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("String space,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("int increaseIndentationChange,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("int decreaseIndentationChange,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("boolean trace");
    _builder.newLine();
    _builder.append("\t");
    _builder.append(") {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("val result = <FormattingData>newArrayList");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("var isFirst = true");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("for (leaf : leafs.leafs)");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("switch leaf {");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("WhitespaceInfo: {");
    _builder.newLine();
    _builder.append("\t\t\t\t\t");
    _builder.append("result += new WhitespaceData(leaf.offset, leaf.length, if(isFirst) increaseIndentationChange else 0, if(isFirst) decreaseIndentationChange else 0,");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t");
    _builder.append("if (trace) new RuntimeException, space)");
    _builder.newLine();
    _builder.append("\t\t\t\t\t");
    _builder.append("isFirst = false");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("CommentInfo: {");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("result");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def protected Iterable<FormattingData> newNewLineData(");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("HiddenLeafs leafs,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("int minNewLines,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("int maxNewLines,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("int increaseIndentationChange,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("int decreaseIndentationChange,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("boolean trace");
    _builder.newLine();
    _builder.append("\t");
    _builder.append(") {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("val result = <FormattingData>newArrayList");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("var applied = false");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("for (leaf : leafs.leafs)");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("switch leaf {");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("WhitespaceInfo: {");
    _builder.newLine();
    _builder.append("\t\t\t\t\t");
    _builder.append("val equalIndentationChange = increaseIndentationChange == decreaseIndentationChange * -1");
    _builder.newLine();
    _builder.append("\t\t\t\t\t");
    _builder.append("if (leaf.trailingComment?.trailing && !leaf.trailingComment?.multiline) {");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t");
    _builder.append("val space = if (leaf.offset == 0) \"\" else if(maxNewLines == 0) null else \" \"");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t");
    _builder.append("result += new WhitespaceData(leaf.offset, leaf.length, 0 , 0, if (trace) new RuntimeException(), space)");
    _builder.newLine();
    _builder.append("\t\t\t\t\t");
    _builder.append("} else if (!applied) {");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t");
    _builder.append("var newLines = Math.min(Math.max(leafs.newLines, minNewLines), maxNewLines)");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t");
    _builder.append("if (newLines < 1 && leaf.offset > 0 &&");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t\t");
    _builder.append("(leaf.leadingComment?.multiline || leaf.trailingComment?.multiline))");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t\t");
    _builder.append("newLines = 1");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t");
    _builder.append("if (leaf.leadingComment?.endsWithNewLine)");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t\t");
    _builder.append("newLines = newLines - 1");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t");
    _builder.append("if (!leaf.leadingComment?.endsWithNewLine && newLines == 0)");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t\t");
    _builder.append("result += new WhitespaceData(leaf.offset, leaf.length, increaseIndentationChange, decreaseIndentationChange,");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t\t\t");
    _builder.append("if (trace) new RuntimeException(), if (leaf.offset == 0) \"\" else if(leafs.containsComment) null else \" \")");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t");
    _builder.append("else");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t\t");
    _builder.append("if(equalIndentationChange && leafs.leafs.last != leaf)");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t\t\t");
    _builder.append("result += new NewLineData(leaf.offset, leaf.length, increaseIndentationChange, decreaseIndentationChange, if (trace) new RuntimeException(), newLines)");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t\t");
    _builder.append("else");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t\t\t");
    _builder.append("result += new NewLineData(leaf.offset, leaf.length, if(equalIndentationChange) 0  else increaseIndentationChange, if(equalIndentationChange) 0 else decreaseIndentationChange, if (trace) new RuntimeException(), newLines)");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t");
    _builder.append("applied = true");
    _builder.newLine();
    _builder.append("\t\t\t\t\t");
    _builder.append("} else {");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t");
    _builder.append("var newLines = 1");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t");
    _builder.append("if (leaf.leadingComment?.endsWithNewLine)");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t\t");
    _builder.append("newLines = newLines - 1");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t");
    _builder.append("if(equalIndentationChange && leafs.leafs.last != leaf)");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t\t");
    _builder.append("result += new NewLineData(leaf.offset, leaf.length, increaseIndentationChange, decreaseIndentationChange, if (trace) new RuntimeException(), newLines)");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t");
    _builder.append("else");
    _builder.newLine();
    _builder.append("\t\t\t\t\t\t\t");
    _builder.append("result += new NewLineData(leaf.offset, leaf.length, 0, 0, if (trace) new RuntimeException(), newLines)");
    _builder.newLine();
    _builder.append("\t\t\t\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("CommentInfo: {");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("result");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def (FormattableDocument)=>Iterable<FormattingData> append(");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("INode node,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("(FormattingDataInit)=>void init");
    _builder.newLine();
    _builder.append("\t");
    _builder.append(") {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("if (node != null) {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("node.hiddenLeafsAfter.newFormattingData(init)");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def (FormattableDocument)=>Iterable<FormattingData> prepend(");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("INode node,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("(FormattingDataInit)=>void init");
    _builder.newLine();
    _builder.append("\t");
    _builder.append(") {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("if (node != null) {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("node.hiddenLeafsBefore.newFormattingData(init)");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def (FormattableDocument)=>Iterable<FormattingData> surround(");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("INode node,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("(FormattingDataInit)=>void init");
    _builder.newLine();
    _builder.append("\t");
    _builder.append(") {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("[ FormattableDocument doc |");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("val result = <FormattingData>newArrayList()");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("if (node != null) {");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("result += node.hiddenLeafsBefore.newFormattingData(init)?.apply(doc) ?: emptyList");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("result += node.hiddenLeafsAfter.newFormattingData(init)?.apply(doc) ?: emptyList");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("result");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def (FormattableDocument)=>Iterable<FormattingData> surround(");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("INode node,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("(FormattingDataInit)=>void before,");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("(FormattingDataInit)=>void after");
    _builder.newLine();
    _builder.append("\t");
    _builder.append(") {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("[ FormattableDocument doc |");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("val result = <FormattingData>newArrayList()");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("if (node != null) {");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("result += node.hiddenLeafsBefore.newFormattingData(before)?.apply(doc) ?: emptyList");
    _builder.newLine();
    _builder.append("\t\t\t\t");
    _builder.append("result += node.hiddenLeafsAfter.newFormattingData(after)?.apply(doc) ?: emptyList");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("result");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class FormattingDataInit {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("public String space = null");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("public Integer newLines = null");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("public int increaseIndentationChange = 0");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("public int decreaseIndentationChange = 0");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("public PreferenceKey key = null");
    _builder.newLine();
    _builder.append("\t");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("def void cfg(PreferenceKey key) {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("this.key = key");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("def void newLine() {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("newLines = 1");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("def void noSpace() {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("space = \"\"");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("def void oneSpace() {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("space = \" \"");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("def void increaseIndentation() {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("increaseIndentationChange = increaseIndentationChange + 1");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("def void decreaseIndentation() {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("decreaseIndentationChange = decreaseIndentationChange - 1");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("override String toString() {");
    _builder.newLine();
    _builder.append("\t\t\t");
    _builder.append("new ToStringHelper().toString(this)");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("package org.eclipse.xtext.xbase.formatting;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("import com.google.common.base.Objects;");
    _builder_1.newLine();
    _builder_1.append("import com.google.common.collect.Iterables;");
    _builder_1.newLine();
    _builder_1.append("import com.google.inject.Inject;");
    _builder_1.newLine();
    _builder_1.append("import java.util.ArrayList;");
    _builder_1.newLine();
    _builder_1.append("import java.util.Arrays;");
    _builder_1.newLine();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.nodemodel.INode;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.preferences.PreferenceKey;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.CollectionLiterals;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Extension;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Functions.Function1;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.IterableExtensions;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.util.ToStringHelper;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class FormattingDataFactory {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class FormattingDataInit {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("public String space = null;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("public Integer newLines = null;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("public int increaseIndentationChange = 0;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("public int decreaseIndentationChange = 0;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("public PreferenceKey key = null;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("public void cfg(final PreferenceKey key) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("this.key = key;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("public void newLine() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("this.newLines = Integer.valueOf(1);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("public void noSpace() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("this.space = \"\";");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("public void oneSpace() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("this.space = \" \";");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("public void increaseIndentation() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("this.increaseIndentationChange = (this.increaseIndentationChange + 1);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("public void decreaseIndentation() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("this.decreaseIndentationChange = (this.decreaseIndentationChange - 1);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("public String toString() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return new ToStringHelper().toString(this);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Inject");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("@Extension");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("private HiddenLeafAccess _hiddenLeafAccess;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("protected Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> newFormattingData(final HiddenLeafs leafs, final Procedure1<? super FormattingDataFactory.FormattingDataInit> init) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> _xblockexpression = null;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("{");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("final FormattingDataFactory.FormattingDataInit data = new FormattingDataFactory.FormattingDataInit();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("init.apply(data);");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("_xblockexpression = this.newFormattingData(leafs, data.key, data);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _xblockexpression;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("protected Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> _newFormattingData(final HiddenLeafs leafs, final Void key, final FormattingDataFactory.FormattingDataInit it) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Function1<FormattableDocument, Iterable<FormattingData>> _function = new Function1<FormattableDocument, Iterable<FormattingData>>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public Iterable<FormattingData> apply(final FormattableDocument doc) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("Integer _elvis = null;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("if (it.newLines != null) {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("_elvis = it.newLines;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("_elvis = Integer.valueOf(0);");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("final int newLines2 = (int) _elvis;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("if (((Objects.equal(it.space, null) && Objects.equal(it.newLines, null)) || ((leafs.getNewLinesInComments() == 0) && ((newLines2 == 0) || Objects.equal(it.space, \"\"))))) {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("return FormattingDataFactory.this.newWhitespaceData(leafs, it.space, it.increaseIndentationChange, it.decreaseIndentationChange, doc.isDebugConflicts());");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("return FormattingDataFactory.this.newNewLineData(leafs, newLines2, newLines2, it.increaseIndentationChange, it.decreaseIndentationChange, doc.isDebugConflicts());");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _function;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("protected Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> _newFormattingData(final HiddenLeafs leafs, final BlankLineKey key, final FormattingDataFactory.FormattingDataInit it) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Function1<FormattableDocument, Iterable<FormattingData>> _function = new Function1<FormattableDocument, Iterable<FormattingData>>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public Iterable<FormattingData> apply(final FormattableDocument doc) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("Iterable<FormattingData> _xblockexpression = null;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("{");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("final int blankline = doc.getCfg().get(key);");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("final int preserve = doc.getCfg().get(XbaseFormatterPreferenceKeys.preserveBlankLines);");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("final int min = (blankline + 1);");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("final int max = Math.max((preserve + 1), min);");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("_xblockexpression = FormattingDataFactory.this.newNewLineData(leafs, min, max, it.increaseIndentationChange, it.decreaseIndentationChange, doc.isDebugConflicts());");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("return _xblockexpression;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _function;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("protected Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> _newFormattingData(final HiddenLeafs leafs, final NewLineOrPreserveKey key, final FormattingDataFactory.FormattingDataInit it) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Function1<FormattableDocument, Iterable<FormattingData>> _function = new Function1<FormattableDocument, Iterable<FormattingData>>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public Iterable<FormattingData> apply(final FormattableDocument doc) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("Iterable<FormattingData> _xblockexpression = null;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("{");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("final boolean newLine = doc.getCfg().get(key);");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("final boolean preserve = doc.getCfg().get(XbaseFormatterPreferenceKeys.preserveNewLines);");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("int _xifexpression = (int) 0;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("if (newLine) {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("_xifexpression = 1;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("_xifexpression = 0;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("int _xifexpression_1 = (int) 0;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("if ((preserve || newLine)) {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("_xifexpression_1 = 1;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("_xifexpression_1 = 0;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("_xblockexpression = FormattingDataFactory.this.newNewLineData(leafs, _xifexpression, _xifexpression_1, it.increaseIndentationChange, it.decreaseIndentationChange, ");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("doc.isDebugConflicts());");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("return _xblockexpression;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _function;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("protected Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> _newFormattingData(final HiddenLeafs leafs, final NewLineKey key, final FormattingDataFactory.FormattingDataInit it) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Function1<FormattableDocument, Iterable<FormattingData>> _function = new Function1<FormattableDocument, Iterable<FormattingData>>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public Iterable<FormattingData> apply(final FormattableDocument doc) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("Iterable<FormattingData> _xblockexpression = null;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("{");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("final boolean newLine = doc.getCfg().get(key);");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("int _xifexpression = (int) 0;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("if (newLine) {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("_xifexpression = 1;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("_xifexpression = 0;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("final int minmax = _xifexpression;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("_xblockexpression = FormattingDataFactory.this.newNewLineData(leafs, minmax, minmax, it.increaseIndentationChange, it.decreaseIndentationChange, doc.isDebugConflicts());");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("return _xblockexpression;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _function;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("protected Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> _newFormattingData(final HiddenLeafs leafs, final PreferenceKey key, final FormattingDataFactory.FormattingDataInit it) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("Class<? extends PreferenceKey> _class = key.getClass();");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("String _plus = (\"Unknown configuration key kind: \" + _class);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("throw new RuntimeException(_plus);");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("protected Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> _newFormattingData(final HiddenLeafs leafs, final WhitespaceKey key, final FormattingDataFactory.FormattingDataInit it) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Function1<FormattableDocument, Iterable<FormattingData>> _function = new Function1<FormattableDocument, Iterable<FormattingData>>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public Iterable<FormattingData> apply(final FormattableDocument doc) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("Iterable<FormattingData> _xblockexpression = null;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("{");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("final boolean space = doc.getCfg().get(key);");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("String _xifexpression = null;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("if (space) {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("_xifexpression = \" \";");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("_xifexpression = \"\";");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("_xblockexpression = FormattingDataFactory.this.newWhitespaceData(leafs, _xifexpression, it.increaseIndentationChange, it.decreaseIndentationChange, doc.isDebugConflicts());");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("return _xblockexpression;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _function;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("protected Iterable<FormattingData> newWhitespaceData(final HiddenLeafs leafs, final String space, final int increaseIndentationChange, final int decreaseIndentationChange, final boolean trace) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("ArrayList<FormattingData> _xblockexpression = null;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("{");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("final ArrayList<FormattingData> result = CollectionLiterals.<FormattingData>newArrayList();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("boolean isFirst = true;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("List<LeafInfo> _leafs = leafs.getLeafs();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("for (final LeafInfo leaf : _leafs) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("boolean _matched = false;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("if (leaf instanceof WhitespaceInfo) {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("_matched=true;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("int _offset = ((WhitespaceInfo)leaf).getOffset();");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("int _length = ((WhitespaceInfo)leaf).getLength();");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("int _xifexpression = (int) 0;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("if (isFirst) {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("_xifexpression = increaseIndentationChange;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("_xifexpression = 0;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("int _xifexpression_1 = (int) 0;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("if (isFirst) {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("_xifexpression_1 = decreaseIndentationChange;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("_xifexpression_1 = 0;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("RuntimeException _xifexpression_2 = null;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("if (trace) {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("_xifexpression_2 = new RuntimeException();");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("WhitespaceData _whitespaceData = new WhitespaceData(_offset, _length, _xifexpression, _xifexpression_1, _xifexpression_2, space);");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("result.add(_whitespaceData);");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("isFirst = false;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("if (!_matched) {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("if (leaf instanceof CommentInfo) {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("_matched=true;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("_xblockexpression = result;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _xblockexpression;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("protected Iterable<FormattingData> newNewLineData(final HiddenLeafs leafs, final int minNewLines, final int maxNewLines, final int increaseIndentationChange, final int decreaseIndentationChange, final boolean trace) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("ArrayList<FormattingData> _xblockexpression = null;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("{");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("final ArrayList<FormattingData> result = CollectionLiterals.<FormattingData>newArrayList();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("boolean applied = false;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("List<LeafInfo> _leafs = leafs.getLeafs();");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("for (final LeafInfo leaf : _leafs) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("boolean _matched = false;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("if (leaf instanceof WhitespaceInfo) {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("_matched=true;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("final boolean equalIndentationChange = (increaseIndentationChange == (decreaseIndentationChange * (-1)));");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("boolean _and = false;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("CommentInfo _trailingComment = ((WhitespaceInfo)leaf).trailingComment();");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("boolean _isTrailing = false;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("if (_trailingComment!=null) {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("_isTrailing=_trailingComment.isTrailing();");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("if (!_isTrailing) {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("_and = false;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("CommentInfo _trailingComment_1 = ((WhitespaceInfo)leaf).trailingComment();");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("boolean _isMultiline = false;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("if (_trailingComment_1!=null) {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_isMultiline=_trailingComment_1.isMultiline();");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("boolean _not = (!_isMultiline);");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("_and = _not;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("if (_and) {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("String _xifexpression = null;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("int _offset = ((WhitespaceInfo)leaf).getOffset();");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("boolean _equals = (_offset == 0);");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("if (_equals) {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_xifexpression = \"\";");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("String _xifexpression_1 = null;");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("if ((maxNewLines == 0)) {");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("_xifexpression_1 = null;");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("_xifexpression_1 = \" \";");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_xifexpression = _xifexpression_1;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("final String space = _xifexpression;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("int _offset_1 = ((WhitespaceInfo)leaf).getOffset();");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("int _length = ((WhitespaceInfo)leaf).getLength();");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("RuntimeException _xifexpression_2 = null;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("if (trace) {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_xifexpression_2 = new RuntimeException();");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("WhitespaceData _whitespaceData = new WhitespaceData(_offset_1, _length, 0, 0, _xifexpression_2, space);");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("result.add(_whitespaceData);");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("if ((!applied)) {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("int newLines = Math.min(Math.max(leafs.getNewLines(), minNewLines), maxNewLines);");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("boolean _and_1 = false;");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("if (!((newLines < 1) && (((WhitespaceInfo)leaf).getOffset() > 0))) {");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("_and_1 = false;");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("boolean _or = false;");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("CommentInfo _leadingComment = ((WhitespaceInfo)leaf).leadingComment();");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("boolean _isMultiline_1 = false;");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("if (_leadingComment!=null) {");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("_isMultiline_1=_leadingComment.isMultiline();");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("if (_isMultiline_1) {");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("_or = true;");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("CommentInfo _trailingComment_2 = ((WhitespaceInfo)leaf).trailingComment();");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("boolean _isMultiline_2 = false;");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("if (_trailingComment_2!=null) {");
    _builder_1.newLine();
    _builder_1.append("                    ");
    _builder_1.append("_isMultiline_2=_trailingComment_2.isMultiline();");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("_or = _isMultiline_2;");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("_and_1 = _or;");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("if (_and_1) {");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("newLines = 1;");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("CommentInfo _leadingComment_1 = ((WhitespaceInfo)leaf).leadingComment();");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("boolean _endsWithNewLine = false;");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("if (_leadingComment_1!=null) {");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("_endsWithNewLine=_leadingComment_1.endsWithNewLine();");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("if (_endsWithNewLine) {");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("newLines = (newLines - 1);");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("boolean _and_2 = false;");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("CommentInfo _leadingComment_2 = ((WhitespaceInfo)leaf).leadingComment();");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("boolean _endsWithNewLine_1 = false;");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("if (_leadingComment_2!=null) {");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("_endsWithNewLine_1=_leadingComment_2.endsWithNewLine();");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("boolean _not_1 = (!_endsWithNewLine_1);");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("if (!_not_1) {");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("_and_2 = false;");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("_and_2 = (newLines == 0);");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("if (_and_2) {");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("int _offset_2 = ((WhitespaceInfo)leaf).getOffset();");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("int _length_1 = ((WhitespaceInfo)leaf).getLength();");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("RuntimeException _xifexpression_3 = null;");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("if (trace) {");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("_xifexpression_3 = new RuntimeException();");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("String _xifexpression_4 = null;");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("int _offset_3 = ((WhitespaceInfo)leaf).getOffset();");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("boolean _equals_1 = (_offset_3 == 0);");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("if (_equals_1) {");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("_xifexpression_4 = \"\";");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("String _xifexpression_5 = null;");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("boolean _containsComment = leafs.containsComment();");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("if (_containsComment) {");
    _builder_1.newLine();
    _builder_1.append("                    ");
    _builder_1.append("_xifexpression_5 = null;");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("                    ");
    _builder_1.append("_xifexpression_5 = \" \";");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("_xifexpression_4 = _xifexpression_5;");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("WhitespaceData _whitespaceData_1 = new WhitespaceData(_offset_2, _length_1, increaseIndentationChange, decreaseIndentationChange, _xifexpression_3, _xifexpression_4);");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("result.add(_whitespaceData_1);");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("if ((equalIndentationChange && (!Objects.equal(IterableExtensions.<LeafInfo>last(leafs.getLeafs()), leaf)))) {");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("int _offset_4 = ((WhitespaceInfo)leaf).getOffset();");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("int _length_2 = ((WhitespaceInfo)leaf).getLength();");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("RuntimeException _xifexpression_6 = null;");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("if (trace) {");
    _builder_1.newLine();
    _builder_1.append("                    ");
    _builder_1.append("_xifexpression_6 = new RuntimeException();");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("NewLineData _newLineData = new NewLineData(_offset_4, _length_2, increaseIndentationChange, decreaseIndentationChange, _xifexpression_6, Integer.valueOf(newLines));");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("result.add(_newLineData);");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("int _offset_5 = ((WhitespaceInfo)leaf).getOffset();");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("int _length_3 = ((WhitespaceInfo)leaf).getLength();");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("int _xifexpression_7 = (int) 0;");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("if (equalIndentationChange) {");
    _builder_1.newLine();
    _builder_1.append("                    ");
    _builder_1.append("_xifexpression_7 = 0;");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("                    ");
    _builder_1.append("_xifexpression_7 = increaseIndentationChange;");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("int _xifexpression_8 = (int) 0;");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("if (equalIndentationChange) {");
    _builder_1.newLine();
    _builder_1.append("                    ");
    _builder_1.append("_xifexpression_8 = 0;");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("                    ");
    _builder_1.append("_xifexpression_8 = decreaseIndentationChange;");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("RuntimeException _xifexpression_9 = null;");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("if (trace) {");
    _builder_1.newLine();
    _builder_1.append("                    ");
    _builder_1.append("_xifexpression_9 = new RuntimeException();");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("NewLineData _newLineData_1 = new NewLineData(_offset_5, _length_3, _xifexpression_7, _xifexpression_8, _xifexpression_9, Integer.valueOf(newLines));");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("result.add(_newLineData_1);");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("applied = true;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("int newLines_1 = 1;");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("CommentInfo _leadingComment_3 = ((WhitespaceInfo)leaf).leadingComment();");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("boolean _endsWithNewLine_2 = false;");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("if (_leadingComment_3!=null) {");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("_endsWithNewLine_2=_leadingComment_3.endsWithNewLine();");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("if (_endsWithNewLine_2) {");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("newLines_1 = (newLines_1 - 1);");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("if ((equalIndentationChange && (!Objects.equal(IterableExtensions.<LeafInfo>last(leafs.getLeafs()), leaf)))) {");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("int _offset_6 = ((WhitespaceInfo)leaf).getOffset();");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("int _length_4 = ((WhitespaceInfo)leaf).getLength();");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("RuntimeException _xifexpression_10 = null;");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("if (trace) {");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("_xifexpression_10 = new RuntimeException();");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("NewLineData _newLineData_2 = new NewLineData(_offset_6, _length_4, increaseIndentationChange, decreaseIndentationChange, _xifexpression_10, Integer.valueOf(newLines_1));");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("result.add(_newLineData_2);");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("int _offset_7 = ((WhitespaceInfo)leaf).getOffset();");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("int _length_5 = ((WhitespaceInfo)leaf).getLength();");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("RuntimeException _xifexpression_11 = null;");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("if (trace) {");
    _builder_1.newLine();
    _builder_1.append("                  ");
    _builder_1.append("_xifexpression_11 = new RuntimeException();");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("NewLineData _newLineData_3 = new NewLineData(_offset_7, _length_5, 0, 0, _xifexpression_11, Integer.valueOf(newLines_1));");
    _builder_1.newLine();
    _builder_1.append("                ");
    _builder_1.append("result.add(_newLineData_3);");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("if (!_matched) {");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("if (leaf instanceof CommentInfo) {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("_matched=true;");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("_xblockexpression = result;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _xblockexpression;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> append(final INode node, final Procedure1<? super FormattingDataFactory.FormattingDataInit> init) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> _xifexpression = null;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("boolean _notEquals = (!Objects.equal(node, null));");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("if (_notEquals) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("_xifexpression = this.newFormattingData(this._hiddenLeafAccess.getHiddenLeafsAfter(node), init);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _xifexpression;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> prepend(final INode node, final Procedure1<? super FormattingDataFactory.FormattingDataInit> init) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> _xifexpression = null;");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("boolean _notEquals = (!Objects.equal(node, null));");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("if (_notEquals) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("_xifexpression = this.newFormattingData(this._hiddenLeafAccess.getHiddenLeafsBefore(node), init);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _xifexpression;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> surround(final INode node, final Procedure1<? super FormattingDataFactory.FormattingDataInit> init) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Function1<FormattableDocument, Iterable<FormattingData>> _function = new Function1<FormattableDocument, Iterable<FormattingData>>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public Iterable<FormattingData> apply(final FormattableDocument doc) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("ArrayList<FormattingData> _xblockexpression = null;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("{");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("final ArrayList<FormattingData> result = CollectionLiterals.<FormattingData>newArrayList();");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("boolean _notEquals = (!Objects.equal(node, null));");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("if (_notEquals) {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("Iterable<FormattingData> _elvis = null;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> _newFormattingData = FormattingDataFactory.this.newFormattingData(FormattingDataFactory.this._hiddenLeafAccess.getHiddenLeafsBefore(node), init);");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("Iterable<FormattingData> _apply = null;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("if (_newFormattingData!=null) {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_apply=_newFormattingData.apply(doc);");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("if (_apply != null) {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_elvis = _apply;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("List<FormattingData> _emptyList = CollectionLiterals.<FormattingData>emptyList();");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_elvis = _emptyList;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("Iterables.<FormattingData>addAll(result, _elvis);");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("Iterable<FormattingData> _elvis_1 = null;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> _newFormattingData_1 = FormattingDataFactory.this.newFormattingData(FormattingDataFactory.this._hiddenLeafAccess.getHiddenLeafsAfter(node), init);");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("Iterable<FormattingData> _apply_1 = null;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("if (_newFormattingData_1!=null) {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_apply_1=_newFormattingData_1.apply(doc);");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("if (_apply_1 != null) {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_elvis_1 = _apply_1;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("List<FormattingData> _emptyList_1 = CollectionLiterals.<FormattingData>emptyList();");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_elvis_1 = _emptyList_1;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("Iterables.<FormattingData>addAll(result, _elvis_1);");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("_xblockexpression = result;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("return _xblockexpression;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _function;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> surround(final INode node, final Procedure1<? super FormattingDataFactory.FormattingDataInit> before, final Procedure1<? super FormattingDataFactory.FormattingDataInit> after) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("final Function1<FormattableDocument, Iterable<FormattingData>> _function = new Function1<FormattableDocument, Iterable<FormattingData>>() {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("public Iterable<FormattingData> apply(final FormattableDocument doc) {");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("ArrayList<FormattingData> _xblockexpression = null;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("{");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("final ArrayList<FormattingData> result = CollectionLiterals.<FormattingData>newArrayList();");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("boolean _notEquals = (!Objects.equal(node, null));");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("if (_notEquals) {");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("Iterable<FormattingData> _elvis = null;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> _newFormattingData = FormattingDataFactory.this.newFormattingData(FormattingDataFactory.this._hiddenLeafAccess.getHiddenLeafsBefore(node), before);");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("Iterable<FormattingData> _apply = null;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("if (_newFormattingData!=null) {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_apply=_newFormattingData.apply(doc);");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("if (_apply != null) {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_elvis = _apply;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("List<FormattingData> _emptyList = CollectionLiterals.<FormattingData>emptyList();");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_elvis = _emptyList;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("Iterables.<FormattingData>addAll(result, _elvis);");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("Iterable<FormattingData> _elvis_1 = null;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> _newFormattingData_1 = FormattingDataFactory.this.newFormattingData(FormattingDataFactory.this._hiddenLeafAccess.getHiddenLeafsAfter(node), after);");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("Iterable<FormattingData> _apply_1 = null;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("if (_newFormattingData_1!=null) {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_apply_1=_newFormattingData_1.apply(doc);");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("if (_apply_1 != null) {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_elvis_1 = _apply_1;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("List<FormattingData> _emptyList_1 = CollectionLiterals.<FormattingData>emptyList();");
    _builder_1.newLine();
    _builder_1.append("              ");
    _builder_1.append("_elvis_1 = _emptyList_1;");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("            ");
    _builder_1.append("Iterables.<FormattingData>addAll(result, _elvis_1);");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("          ");
    _builder_1.append("_xblockexpression = result;");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("return _xblockexpression;");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("};");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("return _function;");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("protected Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> newFormattingData(final HiddenLeafs leafs, final PreferenceKey key, final FormattingDataFactory.FormattingDataInit it) {");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("if (key instanceof BlankLineKey) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return _newFormattingData(leafs, (BlankLineKey)key, it);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("} else if (key instanceof NewLineKey) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return _newFormattingData(leafs, (NewLineKey)key, it);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("} else if (key instanceof NewLineOrPreserveKey) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return _newFormattingData(leafs, (NewLineOrPreserveKey)key, it);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("} else if (key instanceof WhitespaceKey) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return _newFormattingData(leafs, (WhitespaceKey)key, it);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("} else if (key == null) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return _newFormattingData(leafs, (Void)null, it);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("} else if (key != null) {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("return _newFormattingData(leafs, key, it);");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("} else {");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("throw new IllegalArgumentException(\"Unhandled parameter types: \" +");
    _builder_1.newLine();
    _builder_1.append("        ");
    _builder_1.append("Arrays.<Object>asList(leafs, key, it).toString());");
    _builder_1.newLine();
    _builder_1.append("    ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }
}
